<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pypln.apps.clusterer</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/pypln">Project Homepage</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;pypln ::
        <a href="pypln.apps-module.html">Package&nbsp;apps</a> ::
        Module&nbsp;clusterer
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="pypln.apps.clusterer-module.html">Module pypln.apps.clusterer</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-comment">#-*- coding:utf-8 -*-</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-docstring">Applies the clustering</tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-docstring">Created on 10/10/11</tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"><tt class="py-docstring">by Flavio Code&#231;o Coelho</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line"> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"><tt class="py-name">__author__</tt> <tt class="py-op">=</tt> <tt class="py-string">'flavio'</tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line"> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">nltk</tt> <tt class="py-keyword">import</tt> <tt class="py-name">clean_html</tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">nltk</tt> <tt class="py-keyword">import</tt> <tt class="py-name">TextCollection</tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">nltk</tt><tt class="py-op">.</tt><tt class="py-name">corpus</tt> <tt class="py-keyword">import</tt> <tt class="py-name">stopwords</tt> </tt>
<a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">BeautifulSoup</tt> <tt class="py-keyword">import</tt> <tt class="py-name">BeautifulStoneSoup</tt> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">pymongo</tt> <tt class="py-keyword">import</tt> <tt class="py-name">Connection</tt> </tt>
<a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">pymongo</tt><tt class="py-op">.</tt><tt class="py-name">errors</tt> <tt class="py-keyword">import</tt> <tt class="py-name">OperationFailure</tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">math</tt> <tt class="py-keyword">import</tt> <tt class="py-name">log</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">collections</tt> <tt class="py-keyword">import</tt> <tt class="py-name">defaultdict</tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line"> </tt>
<a name="build_TC"></a><div id="build_TC-def"><a name="L20"></a><tt class="py-lineno">20</tt> <a class="py-toggle" href="#" id="build_TC-toggle" onclick="return toggle('build_TC');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pypln.apps.clusterer-module.html#build_TC">build_TC</a><tt class="py-op">(</tt><tt class="py-param">db</tt><tt class="py-op">,</tt> <tt class="py-param">collection</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="build_TC-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="build_TC-expanded"><a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line">    <tt class="py-name">col</tt> <tt class="py-op">=</tt> <tt class="py-name">Connection</tt><tt class="py-op">(</tt><tt class="py-string">'127.0.0.1'</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-name">db</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt id="link-0" class="py-name" targets="Function pypln.pypln.stores.mongostore.collection()=pypln.pypln.stores.mongostore-module.html#collection"><a title="pypln.pypln.stores.mongostore.collection" class="py-name" href="#" onclick="return doclink('link-0', 'collection', 'link-0');">collection</a></tt><tt class="py-op">]</tt> </tt>
<a name="L22"></a><tt class="py-lineno">22</tt>  <tt class="py-line">    <tt class="py-name">tc</tt> <tt class="py-op">=</tt> <tt class="py-name">TextCollection</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">t</tt> <tt class="py-keyword">for</tt> <tt class="py-name">t</tt> <tt class="py-keyword">in</tt> <tt class="py-name">col</tt><tt class="py-op">.</tt><tt class="py-name">find</tt><tt class="py-op">(</tt><tt class="py-name">fields</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'text'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">=</tt><tt id="link-1" class="py-name"><a title="pypln.pypln.stores.mongostore.collection" class="py-name" href="#" onclick="return doclink('link-1', 'collection', 'link-0');">collection</a></tt><tt class="py-op">)</tt> </tt>
<a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">tc</tt> </tt>
</div><a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line"> </tt>
<a name="idf"></a><div id="idf-def"><a name="L25"></a><tt class="py-lineno">25</tt> <a class="py-toggle" href="#" id="idf-toggle" onclick="return toggle('idf');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pypln.apps.clusterer-module.html#idf">idf</a><tt class="py-op">(</tt><tt class="py-param">term</tt><tt class="py-op">,</tt><tt class="py-param">corpus</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="idf-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="idf-expanded"><a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line">    <tt class="py-name">num_texts_with_term</tt> <tt class="py-op">=</tt> <tt class="py-name">sum</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">term</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">in</tt> <tt id="link-2" class="py-name" targets="Method pypln.pypln.stores.mongocorpus.MongoDBCorpusReader.text()=pypln.pypln.stores.mongocorpus.MongoDBCorpusReader-class.html#text"><a title="pypln.pypln.stores.mongocorpus.MongoDBCorpusReader.text" class="py-name" href="#" onclick="return doclink('link-2', 'text', 'link-2');">text</a></tt><tt class="py-op">[</tt><tt class="py-string">'text'</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt id="link-3" class="py-name"><a title="pypln.pypln.stores.mongocorpus.MongoDBCorpusReader.text" class="py-name" href="#" onclick="return doclink('link-3', 'text', 'link-2');">text</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">corpus</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line">    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-number">1.0</tt> <tt class="py-op">+</tt><tt class="py-name">log</tt><tt class="py-op">(</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">corpus</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">num_texts_with_term</tt><tt class="py-op">)</tt> </tt>
<a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line">    <tt class="py-keyword">except</tt> <tt class="py-name">ZeroDivisionError</tt><tt class="py-op">:</tt> </tt>
<a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-number">0</tt> </tt>
</div><a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line"> </tt>
<a name="tf_idf"></a><div id="tf_idf-def"><a name="L32"></a><tt class="py-lineno">32</tt> <a class="py-toggle" href="#" id="tf_idf-toggle" onclick="return toggle('tf_idf');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pypln.apps.clusterer-module.html#tf_idf">tf_idf</a><tt class="py-op">(</tt><tt class="py-param">term</tt><tt class="py-op">,</tt><tt class="py-param">doc</tt><tt class="py-op">,</tt><tt class="py-param">corpus</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="tf_idf-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="tf_idf-expanded"><a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line"><tt class="py-docstring">    Returns the tf_idf for a given term</tt> </tt>
<a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line">    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line">        <tt class="py-name">tfidf</tt> <tt class="py-op">=</tt> <tt class="py-name">dict</tt><tt class="py-op">(</tt><tt class="py-name">doc</tt><tt class="py-op">[</tt><tt class="py-string">'freqdist'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-name">term</tt><tt class="py-op">]</tt><tt class="py-op">/</tt><tt id="link-4" class="py-name" targets="Function pypln.apps.clusterer.idf()=pypln.apps.clusterer-module.html#idf"><a title="pypln.apps.clusterer.idf" class="py-name" href="#" onclick="return doclink('link-4', 'idf', 'link-4');">idf</a></tt><tt class="py-op">(</tt><tt class="py-name">term</tt><tt class="py-op">,</tt><tt class="py-name">corpus</tt><tt class="py-op">)</tt> </tt>
<a name="L38"></a><tt class="py-lineno">38</tt>  <tt class="py-line">    <tt class="py-keyword">except</tt> <tt class="py-name">KeyError</tt><tt class="py-op">:</tt> </tt>
<a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line">        <tt class="py-name">tfidf</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">tfidf</tt> </tt>
</div><a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line"> </tt>
<a name="calculate_distance"></a><div id="calculate_distance-def"><a name="L42"></a><tt class="py-lineno">42</tt> <a class="py-toggle" href="#" id="calculate_distance-toggle" onclick="return toggle('calculate_distance');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pypln.apps.clusterer-module.html#calculate_distance">calculate_distance</a><tt class="py-op">(</tt><tt class="py-param">host</tt><tt class="py-op">=</tt><tt class="py-string">'127.0.0.1'</tt><tt class="py-op">,</tt><tt class="py-param">port</tt><tt class="py-op">=</tt><tt class="py-number">27017</tt><tt class="py-op">,</tt><tt class="py-param">db</tt><tt class="py-op">=</tt><tt class="py-string">'test'</tt><tt class="py-op">,</tt><tt class="py-param">collection</tt><tt class="py-op">=</tt><tt class="py-string">'Docs'</tt><tt class="py-op">,</tt><tt class="py-param">fields</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'text'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-param">query_terms</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="calculate_distance-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="calculate_distance-expanded"><a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line">    <tt id="link-5" class="py-name" targets="Variable pypln.pypln.stores.mongostore.conn=pypln.pypln.stores.mongostore-module.html#conn"><a title="pypln.pypln.stores.mongostore.conn" class="py-name" href="#" onclick="return doclink('link-5', 'conn', 'link-5');">conn</a></tt> <tt class="py-op">=</tt> <tt class="py-name">Connection</tt><tt class="py-op">(</tt><tt class="py-name">host</tt><tt class="py-op">=</tt><tt class="py-name">host</tt><tt class="py-op">,</tt><tt class="py-name">port</tt><tt class="py-op">=</tt><tt class="py-name">port</tt><tt class="py-op">)</tt> </tt>
<a name="L44"></a><tt class="py-lineno">44</tt>  <tt class="py-line">    <tt class="py-name">coll</tt> <tt class="py-op">=</tt> <tt id="link-6" class="py-name"><a title="pypln.pypln.stores.mongostore.conn" class="py-name" href="#" onclick="return doclink('link-6', 'conn', 'link-5');">conn</a></tt><tt class="py-op">[</tt><tt class="py-name">db</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt id="link-7" class="py-name"><a title="pypln.pypln.stores.mongostore.collection" class="py-name" href="#" onclick="return doclink('link-7', 'collection', 'link-0');">collection</a></tt><tt class="py-op">]</tt> </tt>
<a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line">    <tt class="py-name">query_scores</tt> <tt class="py-op">=</tt> <tt class="py-name">defaultdict</tt><tt class="py-op">(</tt><tt class="py-keyword">lambda</tt><tt class="py-op">:</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L46"></a><tt class="py-lineno">46</tt>  <tt class="py-line">    <tt class="py-name">corpus</tt> <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">coll</tt><tt class="py-op">.</tt><tt class="py-name">find</tt><tt class="py-op">(</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">,</tt><tt class="py-name">fields</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'text'</tt><tt class="py-op">,</tt><tt class="py-string">'filename'</tt><tt class="py-op">,</tt><tt class="py-string">'freqdist'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">term</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-name">t</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">t</tt> <tt class="py-keyword">in</tt> <tt class="py-name">query_terms</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L48"></a><tt class="py-lineno">48</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">doc</tt> <tt class="py-keyword">in</tt> <tt class="py-name">corpus</tt><tt class="py-op">:</tt> </tt>
<a name="L49"></a><tt class="py-lineno">49</tt>  <tt class="py-line">            <tt class="py-name">score</tt> <tt class="py-op">=</tt> <tt id="link-8" class="py-name" targets="Function pypln.apps.clusterer.tf_idf()=pypln.apps.clusterer-module.html#tf_idf"><a title="pypln.apps.clusterer.tf_idf" class="py-name" href="#" onclick="return doclink('link-8', 'tf_idf', 'link-8');">tf_idf</a></tt><tt class="py-op">(</tt><tt class="py-name">term</tt><tt class="py-op">,</tt><tt class="py-name">doc</tt><tt class="py-op">,</tt><tt class="py-name">corpus</tt><tt class="py-op">)</tt> </tt>
<a name="L50"></a><tt class="py-lineno">50</tt>  <tt class="py-line">            <tt class="py-keyword">print</tt> <tt class="py-string">'TF-IDF(%s): %s'</tt><tt class="py-op">%</tt><tt class="py-op">(</tt><tt class="py-name">doc</tt><tt class="py-op">[</tt><tt class="py-string">'filename'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">term</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">score</tt> </tt>
<a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line">            <tt class="py-name">query_scores</tt><tt class="py-op">[</tt><tt class="py-name">doc</tt><tt class="py-op">[</tt><tt class="py-string">'_id'</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> <tt class="py-op">+=</tt> <tt class="py-name">score</tt> </tt>
<a name="L52"></a><tt class="py-lineno">52</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">d</tt><tt class="py-op">,</tt><tt class="py-name">s</tt> <tt class="py-keyword">in</tt> <tt class="py-name">sorted</tt><tt class="py-op">(</tt><tt class="py-name">query_scores</tt><tt class="py-op">.</tt><tt class="py-name">items</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L53"></a><tt class="py-lineno">53</tt>  <tt class="py-line">        <tt class="py-keyword">print</tt> <tt class="py-name">d</tt><tt class="py-op">,</tt><tt class="py-name">s</tt> </tt>
</div><a name="L54"></a><tt class="py-lineno">54</tt>  <tt class="py-line"> </tt>
<a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line"> </tt>
<a name="L56"></a><tt class="py-lineno">56</tt>  <tt class="py-line"> </tt>
<a name="L57"></a><tt class="py-lineno">57</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt><tt class="py-op">==</tt><tt class="py-string">"__main__"</tt><tt class="py-op">:</tt> </tt>
<a name="L58"></a><tt class="py-lineno">58</tt>  <tt class="py-line">    <tt id="link-9" class="py-name" targets="Function pypln.apps.clusterer.calculate_distance()=pypln.apps.clusterer-module.html#calculate_distance"><a title="pypln.apps.clusterer.calculate_distance" class="py-name" href="#" onclick="return doclink('link-9', 'calculate_distance', 'link-9');">calculate_distance</a></tt><tt class="py-op">(</tt><tt class="py-name">db</tt><tt class="py-op">=</tt><tt class="py-string">'Results'</tt><tt class="py-op">,</tt><tt id="link-10" class="py-name"><a title="pypln.pypln.stores.mongostore.collection" class="py-name" href="#" onclick="return doclink('link-10', 'collection', 'link-0');">collection</a></tt><tt class="py-op">=</tt><tt class="py-string">'Documentos'</tt><tt class="py-op">,</tt><tt class="py-name">query_terms</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'dengue'</tt><tt class="py-op">,</tt> <tt class="py-string">'math'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/pypln">Project Homepage</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sat Mar 31 10:39:42 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
